<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/production/production_ospurchaseorder/Production_OSPurchaseOrder.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/production/production_ospurchaseorder/Production_OSPurchaseOrder.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'OSPurchase_Id',
                footer: "Foots",
                cnName: '委外采购单',
                name: 'production_ospurchaseorder/Production_OSPurchaseOrder',
                url: "/Production_OSPurchaseOrder/",
                sortName: "OSPurchase_Id"
            });
            const editFormFields = ref({"MoCode":"","ProductCode":"","Supplier":"","Price":"","Qty":"","ProcessMessage":"","OSPurchase_Id":"","DeliveryDate":""});
            const editFormOptions = ref([[{"title":"订单号/采购单号","field":"MoCode","type":"text"},
                               {"dataKey":"outSourceProduct","data":[],"title":"产品编码","field":"ProductCode","type":"select"}],
                              [{"dataKey":"Supplier","data":[],"title":"供应商编码","field":"Supplier","type":"select"},
                               {"title":"单价","field":"Price","type":"decimal"}],
                              [{"title":"数量","required":true,"field":"Qty","type":"number"},
                               {"title":"加工要求","field":"ProcessMessage","type":"textarea"}],
                              [{"title":"采购单Id","required":true,"field":"OSPurchase_Id","disabled":true,"type":"number"},
                               {"title":"交货日期","field":"DeliveryDate","type":"date"}]]);
            const searchFormFields = ref({"MoCode":"","WoCode":"","ProductName":"","ProductCode":""});
            const searchFormOptions = ref([[{"title":"订单号/采购单号","field":"MoCode","type":"text"},{"title":"工单号","field":"WoCode","type":"text"}],[{"title":"产品名称","field":"ProductName","type":"text"},{"dataKey":"outSourceProduct","data":[],"title":"产品编码","field":"ProductCode","type":"text"}]]);
            const columns = ref([{field:'OSPurchase_Id',title:'采购单Id',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'MoCode',title:'订单号/采购单号',type:'string',width:180,align:'left',sort:true},
                       {field:'WoCode',title:'工单号',type:'string',width:180,align:'left'},
                       {field:'ProductName',title:'产品名称',type:'string',width:180,align:'left'},
                       {field:'ProductCode',title:'产品编码',type:'string',bind:{ key:'outSourceProduct',data:[]},width:180,align:'left'},
                       {field:'InvStandard',title:'规格',type:'string',width:180,align:'left'},
                       {field:'Supplier',title:'供应商编码',type:'string',bind:{ key:'Supplier',data:[]},width:180,align:'left'},
                       {field:'Price',title:'单价',type:'decimal',width:110,align:'left'},
                       {field:'Qty',title:'数量',type:'int',width:110,require:true,align:'left'},
                       {field:'ProCode',title:'工序编码',type:'string',width:180,align:'left'},
                       {field:'ProName',title:'工序名称',type:'string',width:180,align:'left'},
                       {field:'CreateDate',title:'创建日期',type:'datetime',width:110,align:'left',sort:true},
                       {field:'CreateID',title:'创建人ID',type:'int',width:80,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人',type:'string',width:130,align:'left'},
                       {field:'Modifier',title:'修改人',type:'string',width:130,align:'left'},
                       {field:'ModifyDate',title:'修改日期',type:'datetime',width:110,align:'left',sort:true},
                       {field:'ModifyID',title:'修改人ID',type:'int',width:80,hidden:true,align:'left'},
                       {field:'VerifyId',title:'审核人ID',type:'int',width:110,align:'left'},
                       {field:'VerifyDate',title:'审核日期',type:'datetime',width:110,align:'left',sort:true},
                       {field:'Verifier',title:'审核人',type:'string',width:180,align:'left'},
                       {field:'Status',title:'状态',type:'int',bind:{ key:'overStatus',data:[]},width:110,align:'left'},
                       {field:'ProcessMessage',title:'加工要求',type:'string',width:220,align:'left'},
                       {field:'DeliveryDate',title:'交货日期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'Unit',title:'单位',type:'string',width:120,align:'left'},
                       {field:'Phone',title:'电话',type:'string',width:120,align:'left'},
                       {field:'Address',title:'地址',type:'string',width:220,align:'left'},
                       {field:'SupplierName',title:'供应商名称',type:'string',width:220,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
